﻿
using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;

namespace Bootstrap5;

[HtmlTag("ol")]
[CssClass("breadcrumb")]
public class Breadcrumb : BootstrapChildContentWithCascadingValueComponentBase<Breadcrumb>
{
    [Parameter] public string Divider { get; set; }
    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        builder.OpenElement(0, "nav");
        if (Divider is not null)
        {
            builder.AddAttribute(1, "style", $"--bs-breadcrumb-divider: '{Divider}';");
        }
        builder.AddContent(2, base.BuildRenderTree);
        builder.CloseElement();
    }
}
